//
//  RequestHttpNetWrok.h
//  CFFinanceProject
//
//  Created by chunfeng on 2018/4/9.
//  Copyright © 2018年 xiaowen. All rights reserved.
//

#import <AFNetworking/AFNetworking.h>

#define ERRORDAOMAIN  @"error:customer"

/**
 *  请求数据结果block
 */
typedef void(^successBlock)(id result);
typedef void (^failtureBlock)(NSError *error);


@interface RequestHttpNetWrok : AFHTTPSessionManager

+(RequestHttpNetWrok *)shareInstance;

/**
 *  post请求 raw json
 */
+ (RequestHttpNetWrok *)requestPostWithParameters:(NSDictionary *)parameters
                                        urlString:(NSString *)urlString
                                     finishHandle:(successBlock)finishHandle
                                       failHandle:(failtureBlock)failHandle;
/**
 *  post请求 form-data
 */
+ (RequestHttpNetWrok *)requestPostWithFormParameters:(NSDictionary *)parameters
                                            urlString:(NSString *)urlString
                                         finishHandle:(successBlock)finishHandle
                                           failHandle:(failtureBlock)failHandle;

/**
 *  get请求
 */
+ (RequestHttpNetWrok *)requestGettWithParameters:(NSDictionary *)parameters
                                        urlString:(NSString *)urlString
                                     finishHandle:(successBlock)finishHandle
                                       failHandle:(failtureBlock)failHandle;

/**
 *  上传图片
 */
+ (RequestHttpNetWrok *)upDataImageWithParameters:(NSDictionary *)parameters
                                        urlString:(NSString *)urlString
                                      fileNameArr:(NSArray *)fileNameArr
                                      dataPathArr:(NSArray *)dataPathArr
                                     finishHandle:(successBlock)finishHandle
                                       failHandle:(failtureBlock)failHandle;
@end
